package com.wlyuan.index.domain.source.valueobj;

import com.wlyuan.core.marker.INamed;
import com.wlyuan.core.marker.NamedMap;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * @author yuanjie
 */
@AllArgsConstructor
@Getter
public enum BalanceStatus implements INamed<Integer> {
    /**
     * 0:待对账,1:对账中,2:已对账,3:已结账
     */
    READY(0, "待对账"),
    RECONCILING(1, "对账中"),
    RECONCILED(2, "已对账"),
    CLOSED(3, "已结账");

    private final Integer value;
    private final String name;

    private static final Map<Integer, BalanceStatus> STATUSES = new NamedMap<>(BalanceStatus.class);

    public static BalanceStatus valueOf(Integer value) {
        return STATUSES.get(value);
    }
}
